//
//  ButtonBoot.swift
//  SwiftUIWidgetDemo
//
//  Created by alanzhangg on 2023/7/12.
//

import SwiftUI

struct ButtonBoot: View {
    
    @State var title: String = "this is a title"
    
    var body: some View {
        VStack(spacing: 20){
            Text(title)
            
            Button("Press me") {
                self.title = "button was pressed"
            }
            
            
            Button(action: {
                self.title = "button #2 was pressed"
            }, label: {
                Text("Save".uppercased())
                    .font(.headline)
                    .fontWeight(.semibold)
                    .foregroundStyle(.white)
                    .padding()
                    .padding(.horizontal, 20)
                    .background(
                        RoundedRectangle(cornerRadius: 25.0)
                            .fill(.blue)
                            .shadow(radius: 10)
                    )
            })
            
            Button(action: {}, label: {
                Circle()
                    .fill(.white)
                    .frame(width: 75, height: 75)
                    .shadow(radius: 10)
                    .overlay {
                        Image(systemName: "heart.fill")
                            .font(.largeTitle)
                            .foregroundStyle(.red)
                    }
            })
            
            
            
            
        }
    }
}

#Preview {
    ButtonBoot()
}
